/**
 * 帧同步下用到的定点数学库和基于此库的碰撞检测库
 */
import decimal from './module/acc-decimal';
// import intersection from './module/acc-intersection';

class Decimal extends decimal {
    static equals(x: decimal.Value, y: decimal.Value) {
        return new decimal(x).eq(y);
    }
    static eq = Decimal.equals

    static greaterThan(x: decimal.Value, y: decimal.Value) {
        return new this(x).gt(y);
    }
    static gt = Decimal.greaterThan

    static greaterThanOrEqualTo(x: decimal.Value, y: decimal.Value) {
        return new this(x).gte(y);
    }
    static gte = Decimal.greaterThanOrEqualTo

    static lessThan(x: decimal.Value, y: decimal.Value) {
        return new this(x).lt(y);
    }
    static lt = Decimal.lessThan

    static lessThanOrEqualTo(x: decimal.Value, y: decimal.Value) {
        return new this(x).lte(y);
    }
    static lte = Decimal.lessThanOrEqualTo

    static isFinite(x: decimal.Value) {
        return new this(x).isFinite();
    }

    static isInteger(x: decimal.Value) {
        return new this(x).isFinite();
    }
    static isInt = Decimal.isInteger

    static isNaN(x: decimal.Value) {
        return new this(x).isNaN();
    }

    static isNegative(x: decimal.Value) {
        return new this(x).isNeg();
    }
    static isNeg = Decimal.isNegative

    static isPositive(x: decimal.Value) {
        return new this(x).isPos();
    }
    static isPos = Decimal.isPositive

    static isZero(x: decimal.Value) {
        return new this(x).isZero();
    }
}

export default Decimal;